<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
</head>
<body>
    
    <div id="app">
        <div>{{info.name}}</div>
        <a v-bind:href="info.url">click me</a> 
    </div>
    
    <script src="https://cdn.jsdelivr.net/npm/vue@2.5.21/dist/vue.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <script type="text/javascript">
        var vm = new Vue({
            el:"#app",
            data(){//此处data是方法
                return {//请求的返回参数必须和json字符串一致
                    info: {
                        name: null,
                        address: {
                            street: null,
                            city: null,
                            country: null
                        },
                        url: null
                    }
                }
            },
            mounted() {//钩子函数（vue生命周期插）链式编程
                axios.get('data.json').then(response => (this.info=response.data));
            } 
        });
    </script>
</body>
</html>